package behaviorModel.visitor.demo.element;

import behaviorModel.visitor.demo.visit.ShoppingCartVisitor;

/**
 * 现在创建一些不同商品的实体类
 */
public class Book implements ItemElement {

    //价格
    private int price;
    //isbn号码
    private String isbnNumber;

    public Book(int cost, String isbn) {
        this.price = cost;
        this.isbnNumber = isbn;
    }

    public int getPrice() {
        return price;
    }

    public String getIsbnNumber() {
        return isbnNumber;
    }

    @Override
    public int accept(ShoppingCartVisitor visitor) {
        return visitor.visit(this);
    }

}